/******************* 公共变量 *******************/
var userId = core.getUrlData('user_id');

/******************* Vue初始化代码 *******************/
var vm = new Vue({
	el: '.wrap',
	data: {
		phone: ''
	},
	methods: {
		changeWx: function () {
			common.layerConfirm({
				content: '是否确认解绑该微信号？',
				yes: function () {
					$.ajax({
						url: removeWxUrl,
						type: 'post',
						success: function(data) {
							console.log(data)

							core.layerHint(data.message);
							setTimeout(function () {
								if (data.status == 1) {
									core.href(logoutUrl);
								} else if (data.result == 1) {
									core.href(logoutUrl);
								}
							}, 2000);
						}
					});
				}
			});
			// layer.open({
			// 	content: '<h2>请选择微信号</h2><div><span><img src="' + wxImg + '" alt="" title=""><em>微信</em></span><span><img src="' + wxImg + '" alt="" title=""><em>微信小号</em></span></div><strong>取消</strong>',
			// 	className: 'change-wx',
			// 	anim: 'up',
			// 	skin: 'footer',
			// 	shadeClose: false,
			// 	success: function (ele) {
			// 		$('.layui-m-layershade, body .layui-m-layer .layui-m-layermain .layui-m-layersection .change-wx .layui-m-layercont strong').on('tap', function () {
			// 			layer.closeAll();
			// 		});
			// 		$('body .layui-m-layer .layui-m-layermain .layui-m-layersection .change-wx .layui-m-layercont div span img').on('tap', function () {
			// 			var $this = $(this);

			// 			if ($this.index()) {

			// 			} else {
							
			// 			}
			// 		});
			// 	}
			// });
		}
	},
	computed: {
		
	},
	components: {
		
	},
	created: function () {
		var _this = this;
		$.ajax({
			url: mobileUrl,
			type: 'post',
			success: function (data) {
				console.log(data)
				
				data.list.phone && (_this.phone = core.hideCenterPhoneNum(data.list.phone));
			}
		});
	},
	mounted: function () {
		common.bindBack();
	},
	updated: function () {
		
	}
});